import request from '@/utils/request'



/** 设备台账管理*/
//列表
export function device(params) {
  return request({
    url: '/device/device/list',
    method: 'get',
    params,
  })
}
//删除
export function deviceDel(id) {
  return request({
    url: '/device/device/'+id,
    method: 'delete',
  })
}
//详情
export function deviceDetail(id) {
  return request({
    url: '/device/device/'+id,
    method: 'get',
  })
}
//新增
export function deviceAdd(params) {
  return request({
    url: '/device/device',
    method: 'post',
    data:params,
  })
}
//编辑  szw修改
export function deviceEdit(params) {
  return request({
    url: '/device/device',
    method: 'put',
    data:params
  })
}
//导出
export function deviceExport(params) {
  return request({
    url: '/device/device/export',
    method: 'get',
    data:params
  })
}
//查询子设备
export function listSubSet(params) {
  return request({
    url: '/device/device/listSubSet',
    method: 'get',
    params,
  })
}

/** 设备分类管理*/
//列表
export function deviceType(params) {
  return request({
    url: '/device/deviceType/list',
    method: 'get',
    params,
  })
}
//列表
export function deviceTypeList(params) {
  return request({
    url: '/device/deviceType/listinfo',
    method: 'get',
    params,
  })
}
//单条
export function deviceTypeParent(id) {
  return request({
    url: '/device/deviceType/' + id,
    method: 'get'
  })
}
//新增
export function deviceTypeAdd(params) {
  return request({
    url: '/device/deviceType',
    method: 'post',
    data:params,
  })
}
//编辑
export function deviceTypeEdit(params) {
  return request({
    url: '/device/deviceType',
    method: 'put',
    data:params
  })
}
//删除
export function deviceTypeDel(id) {
  return request({
    url: '/device/deviceType/'+id,
    method: 'delete',
  })
}
//导出
export function deviceTypeExport(params) {
  return request({
    url: '/device/deviceType/export',
    method: 'get',
    data:params
  })
}

/** 设备存放位置*/
//列表
export function deviceRepo(params) {
  return request({
    url: 'device/deviceRepo/list',
    method: 'get',
    params,
  })
}


/**设备详情**/
//调拨转移记录列表
export function transfer(id,params) {
  return request({
    url: `device-allot-api/device/${id}`,
    method: 'get',
    params
  })
}
//维修记录列表
export function repair(params) {
  return request({
    url: `/device/reportForRepair/maintenanceRecords`,
    method: 'get',
    params
  })
}
//养护记录列表
export function curing(id,params) {
  return request({
    url: `/device/deviceConservetask/newlist/${id}`,
    method: 'get',
    params
  })
}
//巡检记录列表
export function check(id,params) {
  return request({
    url: `/device/deviceInspectionTasksPathResult/listByDeviceId/${id}`,
    method: 'get',
    params
  })
}

//台账--单个详细导出
export function exportDevDes() {
  return request({
    url: `/device/device/exportDevice`,
    method: 'get'
  })
}

//台账--单个履历导出
export function exportDevLl(id) {
  return request({
    url: `/device/device/export/deviceInfo/${id}`,
    method: 'get'
  })
}
//台账--批量导出
export function batchExport(ids){
  return request({
    url: `/device/device/exportMasterDeviceByIds/${ids}`,
    method: 'get',
  })
}
//查询子设备信息
export function listSubSetId(id){
  return request({
    url: `device/device/listSubSet/${id}`,
    method: 'get',
  })
}